#include <my_header.h>
#include <string.h>

ssize_t print_to_one_File(const char* path){
    int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0644);
    ERROR_CHECK(fd, -1, "open_fd1");

    dup2(fd, STDOUT_FILENO);
    dup2(fd, STDERR_FILENO);

    printf("Hello\n");
    fprintf(stderr,"World\n");

    fflush(stdout);
    fflush(stderr);

    close(fd);
    return 0;
}

/* Usage:  */
int main(int argc, char* argv[]){                                  
    ARGS_CHECK(argc, 2);
    ssize_t ret = print_to_one_File(argv[1]);

    return ret;
}

